<?php

namespace app\wechat\controller;

use think\cache\driver\Redis;

class Openid
{
    public $redis;
    public $handler;

    // 初始化redis
    public function redis_init()
    {
        $this->redis = new Redis();
    }

    public function testSet()
    {
        $this->redis_init();
        $this->handler = $this->redis->handler();

        $arr1 = ['test openid', time() + 169200];

        $this->handler->sAdd('sets', json_encode($arr1));
    }
}
